<template>
	<view :style="{'--color':vuex_config.themeColor1}">
		<u-sticky>
			<u-tabs :active-color="vuex_config.themeColor1" :height="80" :list="tabList" :is-scroll="false" :current="current" @change="change"></u-tabs>
		</u-sticky>
		<view v-show="current === 0">
			<num-statics ref="view_0"></num-statics>
		</view>
		<view v-show="current === 1">
			<distor-user ref="view_1"></distor-user>
		</view>
		<view v-show="current === 2">
			<adjust ref="view_2"></adjust>
		</view>
	</view>
</template>

<script>
	import numStatics from './components/numStatics.vue'
	import distUser from './components/distUser.vue'
	import adjust from './components/adjust.vue'
	export default {
		data() {
			return {
				tabList: [{
						name: '汇总'
					},
					{
						name: '股东'
					},
					{
						name: '调整'
					},
				],
				current: 0
			};
		},
		components: {
			'num-statics': numStatics,
			'distor-user': distUser,
			'adjust': adjust,
		},
		onLoad(options) {
			if (options && options.index) {
				this.current = Number(options.index)
				this.$nextTick(() => {
					let str = 'view_' + this.current
					this.$refs[str].init()
				})
			}
		},
		onReachBottom() {
			let str = 'view_' + this.current
			if(this.$refs[str].$onReachBottom){
				this.$refs[str].$onReachBottom()
			}
		},
		methods: {
			change(index) {
				this.current = index
				this.$nextTick(() => {
					let str = 'view_' + this.current
					this.$refs[str].init()
				})
			}
		},
	};
</script>
<style>
	page{
		background-color: #fff;
	}
</style>
<style scoped lang="scss"></style>
